package com.landinfo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springframework.core.annotation.Order;

import javax.persistence.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * app版本管理
 * Create by wj
 * 2018-10-19
 */
@ApiModel(description = "app版本管理 Create by wj 2018-10-19")
@Entity
@Table(name = "app_version_manage")
//@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class AppVersionManage implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
    @SequenceGenerator(name = "sequenceGenerator")
    private Long id;

    /**
     * app版本号
     */
    @ApiModelProperty(value = "app版本号")
    @Column(name = "version_number")
    private String versionNumber;

    /**
     * 版本更新信息
     */
    @ApiModelProperty(value = "版本更新信息")
    @Column(name = "update_info")
    private String updateInfo;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @Column(name = "update_time")
    private ZonedDateTime updateTime;

    /**
     * 已更新用户
     */
    @ApiModelProperty(value = "已更新用户")
    @Column(name = "updated_person")
    private String updatedPerson;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getVersionNumber() {
        return versionNumber;
    }

    public AppVersionManage versionNumber(String versionNumber) {
        this.versionNumber = versionNumber;
        return this;
    }

    public void setVersionNumber(String versionNumber) {
        this.versionNumber = versionNumber;
    }

    public String getUpdateInfo() {
        return updateInfo;
    }

    public AppVersionManage updateInfo(String updateInfo) {
        this.updateInfo = updateInfo;
        return this;
    }

    public void setUpdateInfo(String updateInfo) {
        this.updateInfo = updateInfo;
    }

    public ZonedDateTime getUpdateTime() {
        return updateTime;
    }

    public AppVersionManage updateTime(ZonedDateTime updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public void setUpdateTime(ZonedDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdatedPerson() {
        return updatedPerson;
    }

    public AppVersionManage updatedPerson(String updatedPerson) {
        this.updatedPerson = updatedPerson;
        return this;
    }

    public void setUpdatedPerson(String updatedPerson) {
        this.updatedPerson = updatedPerson;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AppVersionManage appVersionManage = (AppVersionManage) o;
        if (appVersionManage.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), appVersionManage.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "AppVersionManage{" +
            "id=" + getId() +
            ", versionNumber='" + getVersionNumber() + "'" +
            ", updateInfo='" + getUpdateInfo() + "'" +
            ", updateTime='" + getUpdateTime() + "'" +
            ", updatedPerson='" + getUpdatedPerson() + "'" +
            "}";
    }
}
